package cn.oniokey.waterDetection.controller;


import cn.oniokey.waterDetection.domain.Water;
import cn.oniokey.waterDetection.service.WaterService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 此接口仅供开发测试,生产环境请注释掉此接口
 */
@RestController
@RequestMapping("api/water")
public class InsertWaterController {

    final
    WaterService waterService;

    public InsertWaterController(WaterService waterService) {
        this.waterService = waterService;
    }

    @PostMapping("/insert")
    public String insertWater(@RequestBody Water water) {
        waterService.insert(water);
        return "水资源数据添加成功";
    }

}
